██╗      █████╗ ███╗   ██╗██████╗ ███╗   ███╗██╗███╗   ██╗███████╗    ███╗   ███╗ ██████╗ ██████╗ 
██║     ██╔══██╗████╗  ██║██╔══██╗████╗ ████║██║████╗  ██║██╔════╝    ████╗ ████║██╔═══██╗██╔══██╗
██║     ███████║██╔██╗ ██║██║  ██║██╔████╔██║██║██╔██╗ ██║█████╗      ██╔████╔██║██║   ██║██║  ██║
██║     ██╔══██║██║╚██╗██║██║  ██║██║╚██╔╝██║██║██║╚██╗██║██╔══╝      ██║╚██╔╝██║██║   ██║██║  ██║
███████╗██║  ██║██║ ╚████║██████╔╝██║ ╚═╝ ██║██║██║ ╚████║███████╗    ██║ ╚═╝ ██║╚██████╔╝██████╔╝
╚══════╝╚═╝  ╚═╝╚═╝  ╚═══╝╚═════╝ ╚═╝     ╚═╝╚═╝╚═╝  ╚═══╝╚══════╝    ╚═╝     ╚═╝ ╚═════╝ ╚═════╝ 
                                                                                                  
Landmine Mod - CLEO Script for GTA San Andreas
==============================================
Adds a functional deployable landmine weapon that can be placed on ground or vehicles, with configurable behavior and optional custom weapon support.

Author: AlvarynGTA  
Version: 1.3


Requirements:
-------------
* GTA San Andreas
* CLEO 4 / CLEO+
* ModLoader
* fastman92 Limit Adjuster (recommended)
* Open Limit Adjuster (highly recommended)

Installation:
-------------
1. Copy the Landmine Mod folder into modloader.
2. Adjust LMSettings.ini according to your preferences.
3. (Optional) Add the weapon line from README.txt into:
   fastman92_limit_adjuster -> gtasa_weapon_config.dat
4. (Optional) The weaponLines folder contains predefined weapon configs.

Usage:
------
1. Equip the WeaponID configured in LMSettings.ini.
2. Press the fire button to start placing the landmine.
3. The character will play the bomb planting animation.
4. The action can be cancelled by pressing the fire button again.

Features:
---------
* Deployable landmine using a dedicated weapon slot.
* Supports 2-player mode.
* Useful for strategic situations, Gang Wars or simply causing chaos.
* Custom weapon model properly aligned in player hands.
* Custom HUD icon created specifically for the landmine weapon.
* WeaponID configurable through FLA.
* Landmine ammo affected by:
  - 100% completion infinite ammo bonus
  - Infinite ammo cheat
* Mine object model independent from weapon model (see Notes).
* Automatically aligns to terrain slope.
* Vehicle attachment support.
* Configurable activation delay and lifetime.
* Optional invisibility after arming.
* Debug mode available.
* Optional map pickups.


Optional Pickups Locations:
---------------------------
* Ocean Docks
* Easter Basin
* Verdant Meadows
* Restricted Area
* K.A.C.C.


Weapon Configuration:
---------------------
* The "weaponLines" folder provides the necessary data to register the Landmine
  as a standalone weapon without replacing any existing weapon.
* Copy the provided line into:

fastman92_limit_adjuster -> gtasa_weapon_config.dat

Example:

[ID]	LANDMINE	-1	1	0	5	164	40	178	1.0	GRENADE

Limit Adjuster Setup (IMPORTANT):
---------------------------------
If you are using a custom WeaponID or custom models you must configure fastman92 Limit Adjuster properly to avoid crashes.

Required settings in fastman92limitAdjuster.ini:

Enable weapon type loader = 1

Increase +1 in:
Weapon type loader, number of type IDs

To prevent crashes with custom objects increase:
Count of killable model IDs

Recommended:
Use Open Limit Adjuster together with fastman92 Limit Adjuster for best compatibility.


Notes:
------
* ModelID does NOT refer to the weapon model.
  ModelID is the object model that will be spawned as the landmine.
* Make sure custom WeaponID does not conflict with other weapon mods.
* WeaponID defines the weapon slot used to deploy mines.
* ModelID and WeaponID are independent and do not need to match.
* `.ini` settings can be reloaded in-game with SHIFT + F7.
* Changes only affect newly placed mines.
* Extra pickups are optional.

Common Issues:
--------------
If the game crashes when placing a mine:

* Verify weapon type loader is enabled.
* Increase weapon type slots.
* Increase killable model IDs.
* Check WeaponID conflicts.
* Make sure Open Limit Adjuster is installed.


Changelog:
----------
v1.3
* Code improvements:
- Now runs while SA-MP is not being launched
- Save game safer and optional pickups are safer when saving and subsequently uninstalling the mod
- Fixed a bug where pedestrians or vehicles would disappear if placed nearby
- Now any character can place a mine (experimental)

v1.2
* Removed global variable to prevent potential SCM conflicts.
* Implemented shared runtime mine counter.
* Improved planting animation timing for more natural placement.

v1.1
* Minor CLEO script fixes.
* Minor weapon icon improvements.

v1.0
* Initial release.


Reference:
-------------------
https://libertycity.net/user/AlvarynGTA
https://www.gtainside.com/user/AlvarynGTA